select a.ilockLocNumber as ilockLocNumber,a.ilockInfoNumber as ilockInfoNumber,a.ilockLocLng as ilockLocLng,a.ilockLocLat as ilockLocLat,a.ilockLocTime as ilockLocTime from Ilockloc as a where a.ilockLocTime in (select max(b.ilockLocTime)from Ilockloc as b group by b.ilockInfoNumber) and ((a.ilockLocLng-320)*(a.ilockLocLng-320) +(a.ilockLocLat-400)*(a.ilockLocLat-400)<10000)